import useMainStore from "@/store";
import type { ReactNode } from "react";

interface AuthAuthorizationProps {
  permission: string;
  children: ReactNode;
}
  
const AuthAuthorization = ({ permission, children }: AuthAuthorizationProps) => {
    const {permissions} = useMainStore();
    if (!permissions.includes(permission)) {
        return null;
    }
    return <>{children}</>;
};  
export default AuthAuthorization;  